﻿using System;
using System.Text;
using System.Web;

namespace TSharp.Core.AppBox.Handlers
{
    internal class NullHttpHandler : BaseHttpHandler
    {

        //static Type currType = GetType();

        public NullHttpHandler(HttpContext context, string requestType, string url, string pathTranslated)
            : base(context, requestType, url, pathTranslated)
        { }

        public override void ProcessRequest(HttpContext context)
        {
            context.Response.Write(string.Format(@"这是个空白的处理器：》》{0} <br>
_requestType : {1}  <br>
_url : {2} <br>
_pathTranslated : {3}  <br>
", DateTime.Now.ToString(),
  this._requestType,
  this.Url,
  this._pathTranslated)
  );

            context.Response.Write(System.Web.HttpUtility.HtmlEncode("<&>") + "<Br>");
            StringBuilder sb = new StringBuilder();

            string p = context.Request.ApplicationPath;
            foreach (var t in ThreadPoolHandlerFactory.types)
            {
                sb.AppendFormat(@"<a href=""{1}/tjb/{0}.axd"">{0}</a><br>", t.Name, p == "/" ? "" : p);
            }

            sb.Append("<br>");
            context.Response.Write(sb.ToString());
        }
    }
}